<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"> <style>
	.KEYW {color: #933;}
	.COMM {color: #bbb; font-style: italic;}
	.NUMB {color: #393;}
	.STRN {color: #393;}
	.REGX {color: #339;}
	.linenumber {border-right: 1px dotted #666; color: #666; font-style: normal;}
	</style></head><body><pre><span class='linenumber'>  1</span> <span class="COMM">/*
<span class='linenumber'>  2</span> 
<span class='linenumber'>  3</span> The 2112 Standard Portal Persister
<span class='linenumber'>  4</span> Replace this file with your own persistence Layer if neccessary.
<span class='linenumber'>  5</span> */</span><span class="WHIT">
<span class='linenumber'>  6</span> 
<span class='linenumber'>  7</span> 
<span class='linenumber'>  8</span> 
<span class='linenumber'>  9</span> 
<span class='linenumber'> 10</span> 
<span class='linenumber'> 11</span> </span><span class="COMM">//Namespace 2112</span><span class="WHIT">
<span class='linenumber'> 12</span> </span><span class="NAME">window.NS2112</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">window.NS2112</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'> 13</span> 
<span class='linenumber'> 14</span> 
<span class='linenumber'> 15</span> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">handleSuccess</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">o</span><span class="PUNC">)</span><span class="WHIT">
<span class='linenumber'> 16</span> </span><span class="PUNC">{</span><span class="WHIT">  </span><span class="WHIT">
<span class='linenumber'> 17</span> </span><span class="WHIT">  </span><span class="NAME">NS2112.stdPersister.makeArray</span><span class="PUNC">(</span><span class="NAME">o.responseText</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">NS2112.stdPersister.vSettings</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'> 18</span> </span><span class="WHIT">  </span><span class="COMM">//alert(o.responseText) ;  </span><span class="WHIT">
<span class='linenumber'> 19</span> </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'> 20</span> 
<span class='linenumber'> 21</span> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">handleFailure</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">o</span><span class="PUNC">)</span><span class="WHIT">
<span class='linenumber'> 22</span> </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'> 23</span> </span><span class="WHIT">   </span><span class="NAME">alert</span><span class="PUNC">(</span><span class="STRN">"Failed"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'> 24</span> </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'> 25</span> 
<span class='linenumber'> 26</span> 
<span class='linenumber'> 27</span> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">callback</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT">  </span><span class="WHIT">
<span class='linenumber'> 28</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">  </span><span class="WHIT">
<span class='linenumber'> 29</span> </span><span class="WHIT">  </span><span class="NAME">success</span><span class="PUNC">:</span><span class="NAME">handleSuccess</span><span class="PUNC">,</span><span class="WHIT">   </span><span class="WHIT">
<span class='linenumber'> 30</span> </span><span class="WHIT">  </span><span class="NAME">failure</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">handleFailure</span><span class="PUNC">,</span><span class="WHIT">   </span><span class="WHIT">
<span class='linenumber'> 31</span> </span><span class="WHIT">  </span><span class="NAME">argument</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="NAME">foo</span><span class="PUNC">:</span><span class="STRN">"foo"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">bar</span><span class="PUNC">:</span><span class="STRN">"bar"</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">   </span><span class="WHIT">
<span class='linenumber'> 32</span> </span><span class="WHIT">  </span><span class="NAME">cache</span><span class="PUNC">:</span><span class="KEYW">false</span><span class="WHIT"> </span><span class="WHIT">
<span class='linenumber'> 33</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">  </span><span class="WHIT">
<span class='linenumber'> 34</span> 
<span class='linenumber'> 35</span> 
<span class='linenumber'> 36</span> 
<span class='linenumber'> 37</span> 
<span class='linenumber'> 38</span> 
<span class='linenumber'> 39</span> 
<span class='linenumber'> 40</span> 
<span class='linenumber'> 41</span> 
<span class='linenumber'> 42</span> 
<span class='linenumber'> 43</span> </span><span class="NAME">NS2112.stdPersister</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">strName</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">pCallback</span><span class="PUNC">)</span><span class="WHIT">
<span class='linenumber'> 44</span> </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'> 45</span> </span><span class="WHIT">   </span><span class="NAME">this.asyncReq</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'> 46</span> </span><span class="WHIT">   </span><span class="NAME">this.m_pCallback</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">pCallback</span><span class="WHIT"> </span><span class="WHIT">
<span class='linenumber'> 47</span> </span><span class="WHIT">	</span><span class="NAME">this.Name</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">strName</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'> 48</span> </span><span class="WHIT">   </span><span class="NAME">this.storeURI</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">'/2112PowerWindows/php/xmlPersister.php?'</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="WHIT">
<span class='linenumber'> 49</span> </span><span class="WHIT">      </span><span class="STRN">'&TOPIC=store'</span><span class="WHIT">  </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'> 50</span> </span><span class="WHIT">   </span><span class="NAME">this.loadURI</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">'/2112PowerWindows/php/xmlPersister.php?'</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="WHIT">
<span class='linenumber'> 51</span> </span><span class="WHIT">      </span><span class="STRN">'&TOPIC=load'</span><span class="WHIT">  </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'> 52</span> </span><span class="WHIT">   </span><span class="NAME">this.store</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">strPostData</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">bCallAsync</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'> 53</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">request</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">YAHOO.util.Connect.asyncRequest</span><span class="PUNC">(</span><span class="STRN">'GET'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">this.storeURI</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">callback</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="WHIT">
<span class='linenumber'> 54</span> </span><span class="WHIT">   </span><span class="WHIT">
<span class='linenumber'> 55</span> </span><span class="WHIT">   </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'> 56</span> 
<span class='linenumber'> 57</span> </span><span class="WHIT">   </span><span class="NAME">this.load</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">     </span><span class="WHIT">
<span class='linenumber'> 58</span> </span><span class="WHIT">     </span><span class="NAME">this.asyncReq</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">YAHOO.util.Connect.asyncRequest</span><span class="PUNC">(</span><span class="STRN">'GET'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">this.loadURI</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="NAME">success</span><span class="PUNC">:</span><span class="NAME">this.m_pCallback</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'> 59</span> </span><span class="WHIT">   </span><span class="NAME">this.checkComplete</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT">
<span class='linenumber'> 60</span> </span><span class="WHIT">   </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'> 61</span> </span><span class="WHIT">      </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">YAHOO.util.Connect.isCallInProgress</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="WHIT"> </span><span class="NAME">this.asyncReq</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'> 62</span> </span><span class="WHIT">   </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'> 63</span> 
<span class='linenumber'> 64</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'> 65</span> 
<span class='linenumber'> 66</span> </span><span class="NAME">NS2112.stdPersister.vSettings</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Array</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT"> </span><span class="WHIT">
<span class='linenumber'> 67</span> 
<span class='linenumber'> 68</span> 
<span class='linenumber'> 69</span> </span><span class="NAME">NS2112.stdPersister.makeArray</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">strResponseXML</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">resultArray</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="WHIT">
<span class='linenumber'> 70</span> </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'> 71</span> </span><span class="WHIT">	   </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">parser</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">DOMParser</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT"> </span><span class="COMM">//SARISSA</span><span class="WHIT">
<span class='linenumber'> 72</span> </span><span class="WHIT">		</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">domDoc</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'> 73</span> </span><span class="WHIT">		</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">			</span><span class="WHIT">
<span class='linenumber'> 74</span> </span><span class="WHIT">		</span><span class="WHIT">
<span class='linenumber'> 75</span> </span><span class="WHIT">		</span><span class="KEYW">try</span><span class="WHIT">
<span class='linenumber'> 76</span> </span><span class="WHIT">		</span><span class="PUNC">{</span><span class="WHIT">					 </span><span class="WHIT">
<span class='linenumber'> 77</span> </span><span class="WHIT">			</span><span class="NAME">domDoc</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">parser.parseFromString</span><span class="PUNC">(</span><span class="NAME">strResponseXML</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"text/xml"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">			      </span><span class="WHIT">
<span class='linenumber'> 78</span> </span><span class="WHIT">		</span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'> 79</span> </span><span class="WHIT">		</span><span class="KEYW">catch</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="WHIT">
<span class='linenumber'> 80</span> </span><span class="WHIT">		</span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'> 81</span> </span><span class="WHIT">			</span><span class="NAME">alert</span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'> 82</span> </span><span class="WHIT">		</span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'> 83</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">cat</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">domDoc.getElementsByTagName</span><span class="PUNC">(</span><span class="STRN">'*'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'> 84</span> </span><span class="WHIT">      </span><span class="KEYW">for</span><span class="PUNC">(</span><span class="WHIT">  </span><span class="NAME">i</span><span class="PUNC">=</span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">cat.length</span><span class="PUNC">;</span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT">
<span class='linenumber'> 85</span> </span><span class="WHIT">		</span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'> 86</span> </span><span class="WHIT">        </span><span class="COMM">// alert(cat[i].tagName)  ; //cat.item(i).firstChild.data</span><span class="WHIT">
<span class='linenumber'> 87</span> </span><span class="WHIT">        </span><span class="NAME">resultArray</span><span class="PUNC">[</span><span class="NAME">cat</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">tagName</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">cat.item</span><span class="PUNC">(</span><span class="NAME">i</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">firstChild.data</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT"> </span><span class="WHIT">
<span class='linenumber'> 88</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'> 89</span> </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'> 90</span> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'> 91</span> 
<span class='linenumber'> 92</span> </span><span class="NAME">NS2112.stdPersister.selfTest</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="NAME">alert</span><span class="PUNC">(</span><span class="STRN">"NS2112.stdPersister"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'> 93</span> 
<span class='linenumber'> 94</span> </span></pre></body></html>